package com.flyox.game.fivetiger.bean;

import java.io.Serializable;

/**
 * 数据传输内容包装类
 * 
 * @author sunwei
 * 
 */
public class MsgPackage implements Serializable {
	/**
	 * 是否自动检查 成势 是否可以取消拔棋
	 */
	private static final long serialVersionUID = -9209270316719400651L;
	private int cmd;
	private String cmdPlayer = CONSTS.SYS_SERVER_NAME;// 命令执行方 即上一个操作者 for
														// undo
	private String msg;
	private Position firstPos;
	private Position secondPos;

	private int currentState = CONSTS.CMD_BEGIN;// 当前状态
	private String currentPlayer = CONSTS.SYS_SERVER_NAME;// 当前操作方
	private int canRemoveChessCount = 0;// 剩余拔棋或者压棋数量
	private boolean otherSideNeedCut = false;// 无棋可走才能相互拔掉对方一个棋子

	private int fullLayout[][] = null;// 棋盘填满之后的布局 悔棋时使用

	private ChessOptions chessOptions=null;
	
	public int getCmd() {
		return cmd;
	}

	public void setCmd(int cmd) {
		this.cmd = cmd;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Position getFirstPos() {
		return firstPos;
	}

	public void setFirstPos(Position firstPos) {
		this.firstPos = firstPos;
	}

	public Position getSecondPos() {
		return secondPos;
	}

	public void setSecondPos(Position secondPos) {
		this.secondPos = secondPos;
	}

	public int getCurrentState() {
		return currentState;
	}

	public void setCurrentState(int currentState) {
		this.currentState = currentState;
	}

	public String getCurrentPlayer() {
		return currentPlayer;
	}

	public void setCurrentPlayer(String currentPlayer) {
		this.currentPlayer = currentPlayer;
	}

	public int getCanRemoveChessCount() {
		return canRemoveChessCount;
	}

	public void setCanRemoveChessCount(int canRemoveChessCount) {
		this.canRemoveChessCount = canRemoveChessCount;
	}

	public boolean isOtherSideNeedCut() {
		return otherSideNeedCut;
	}

	public void setOtherSideNeedCut(boolean otherSideNeedCut) {
		this.otherSideNeedCut = otherSideNeedCut;
	}

	public String getCmdPlayer() {
		return cmdPlayer;
	}

	public void setCmdPlayer(String cmdPlayer) {
		this.cmdPlayer = cmdPlayer;
	}

	public int[][] getFullLayout() {
		return fullLayout;
	}

	public void cloneFullLayout(int[][] fullLayout) {
		this.fullLayout = new int[5][5];
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 5; j++) {
				this.fullLayout[i][j] = fullLayout[i][j];
			}
		}
	}

	public String toString() {
		String res = "cmd=" + this.getCmd() + " cmdPlayer=" + this.getCmdPlayer() + " curplayer=" + this.getCurrentPlayer() + " state=" + this.getCurrentState() + " fpos="
				+ this.getFirstPos().toString();
		return res;
	}

	public void showLayout() {
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 5; j++) {
				System.out.print(fullLayout[i][j] + " ");
			}
			System.out.println();
		}
	}

	public ChessOptions getChessOptions() {
		return chessOptions;
	}

	public void setChessOptions(ChessOptions chessOptions) {
		this.chessOptions = chessOptions;
	}
}
